import http from '@/utils/http';

export const postLoginWxMin = (data) => {
    return http({ url: '/login/wxMin', method: 'post', data });
};

// 开发(学习)环境中模拟登录，方便同学看到效果-生产中不会有这种登录方式
export const postLoginWxMinSimple = (phoneNumber) => {
    return http({ url: '/login/wxMin/simple', method: 'post', data: { phoneNumber } });
};

export const getMemberProfile = (data) => {
    return http({ url: '/member/profile' });
};

// 修改头像 - 上传资源，不能使用 http，要使用的是 uni.uploadFile
export const postMemberProfileAvatar = (data) => {
    return uni.uploadFile({
        url: '/member/profile/avatar',
        filePath: data,
        name: 'file'
    })
}

// 修改个人信息
export const putMemberProfile = (data) => {
    return http({ url: '/member/profile', method: 'put', data });
};

